//
//  AppDelegate.swift
//  weibo
//
//  Created by wang_h on 2017/5/24.
//  Copyright © 2017年 wang_h. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    var defaultViewController : UIViewController {
        let islogin = UserAccountViewModel.shareInstance.isLogin
        print(UserAccountViewModel.shareInstance.accountPath)
        return islogin ? WelcomeViewController() : UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController()!
    }
    

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        //设置全局颜色
        UITabBar.appearance().tintColor = UIColor.orange
        UINavigationBar.appearance().tintColor = UIColor.orange
        
        //创建window
        self.window = UIWindow(frame:UIScreen.main.bounds)
        self.window?.rootViewController = defaultViewController
        self.window?.makeKeyAndVisible()

        return true
    }

}

